<?php
require_once "errorCodes.php";
class ErrorCodes {

	public function getErrorMessage($errCode){

		if (!isset($errCode)){
			$errCode = "004";
		}

		$messages = array
		(
		"001" => "Could not log user in. Possible DB error.",
		"002" => "Invalid credentials. Try again.",
		"003" => "Could not log user out.",
		"004" => "Unknown error occured",
		"005" => "Could not retrieve transaction.",
		"006" => "Could not delete budget item.",
		"007" => "Could not save account details.",
		"008" => "Could not get budget items.",
		"009" => "Could not get accounts as budget items.",
		"010" => "Could not save transaction.",
		"011" => "Error. Parameter not set.",
		"012" => "Error. Could not getSavingsTransactions.",
		"013" => "Error. Could not registerSavings.",
		"014" => "Error. Could not doSavingsReconcile.",
		"015" => "Error. Could not deleteTransaction.",
		"016" => "Error. Could not createAccount.",
		"016" => "Error. Could not getBudgetItemsForBudget.",
		"017" => "Error. Could not deleteBudget.",
		"018" => "Error. Could not deleteBudget.",
		"019" => "Error. Could not savePreferences.",
		"020" => "Error. The username supplied does not exist.",
		"021" => "Error. Could not send email.",
		"022" => "Error. The username you have selected already exists. Try another one.",
		"023" => "Error. We have picked up that the email address you supplied already exists. Try forgot username.",
		"024" => "Error. Your account has been disabled. Send an email to 'sabside@16thnote.co.za' if you feel this is inappropriate.",
		"026" => "Your transaction has been saved but the function is also trying to insert a transaction that might already exist. Do you want to continue inserting it?",
		"027" => "Error. This association already exists.",

		//GENERAL
		"025" => "Error. supplied field is too short."
		);

		return $messages[$errCode];
	}
}

?>